<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript">

        var testNode = document.getElementById('test');
        (function (document, window) {
            var ln = {
                readyV1:function (callback) {
                    var src = (window.location.protocol == 'https') ? '://0' : 'javascript:void(0)',
                            ieDomScript;
                    document.write("<script id=\"ieDomScript\" defer='defer'src=" + src + "><\/scr" + "ipt>");
                    ieDomScript = document.getElementById("ieDomScript");
                    ieDomScript.onreadystatechange = function () {
                        if (this.readyState === "complete") {
                            ieDomScript.onreadystatechange = null;
                            ieDomScript.parentNode.removeChild(ieDomScript);
                            callback();
                        }
                    };
                },
                readyV2:function (callback) {
                    document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
                    var script = document.getElementById("__ie_onload");
                    script.onreadystatechange = function () {
                        if (this.readyState == "complete") {
                            callback(); // call the onload handler
                        }
                    };
                }
            };
            window.ln = ln;
        }(document, window));
        ln.readyV2(function () {
            console.log('ieReady--111!');
        });
        window.onload = function () {
            console.log('window onload!');
        };
        /**
         * 这里的测试结果：
         * IE下：在没有图片，flash那些东西的时候，onload比那种timer的解决方案还快。
         */

    </script>
</head>
<body>
<img src="http://www.baidu.com/img/baidu_sylogo1.gif" width="270" height="129">
<img src="http://www.planeart.cn/demo/imgZoom/_demo/b2.jpg" alt="">
<button id="test">TestButton</button>


</body>
</html>